<!DOCTYPE html>


<html lang="en">
  

    <head>
      <meta charset="utf-8" />
        
      <meta
        name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1"
      />
      <title>管理|关于OKR的思考 |  麦田麦穗</title>
  <meta name="generator" content="hexo-theme-ayer">
      
      <link rel="shortcut icon" href="/favicon.ico" />
       
<link rel="stylesheet" href="/dist/main.css">

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css"
      />
      
<link rel="stylesheet" href="/css/custom.css">
 
      <script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
       
 

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
      />
      <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>

      <!-- mermaid -->
      
      <style>
        .swal2-styled.swal2-confirm {
          font-size: 1.6rem;
        }
      </style>
    </head>
  </html>
</html>


<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-关于OKR的思考"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  管理|关于OKR的思考
</h1>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2021/09/06/%E5%85%B3%E4%BA%8EOKR%E7%9A%84%E6%80%9D%E8%80%83/" class="article-date">
  <time datetime="2021-09-06T12:01:29.000Z" itemprop="datePublished">2021-09-06</time>
</a>   
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> Word count:</span>
            <span class="post-count">1.8k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> Reading time≈</span>
            <span class="post-count">6 min</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <p>起因是由于我的老板在月初的时候又布置任务要求写下本月的关键目标Top3。也就是OKR Top3,并且要求用SMART原则。</p>
<p>在此之前领导一直告诉我们KPI和OKR是分别用来管理销售团队和职能团队的。因为销售团队很容易用数据指标来衡量工作结果，但职能团队的工作并不好用数据指标来衡量。</p>
<p>但是SMART原则五条又有Measurable(可衡量的),于是我有点惊讶。如果OKR+SMART那跟KPI有什么区别？</p>
<span id="more"></span>

<p>于是我认为OKR+SMART = KPI. 但究竟是不是这样呢？</p>
<h2 id="OKR和KPI"><a href="#OKR和KPI" class="headerlink" title="OKR和KPI"></a>OKR和KPI</h2><p>先来看看KPI，因为本身OKR是后来才提出来的概念。相较于OKR，KPI更广和更早被人所知。</p>
<p>KPI 是 Key Performance Indicator 的缩写，中文名称是「关键绩效指标」，即一系列衡量工作成效的重要指标。</p>
<p>关键点有了，<code>指标</code></p>
<p><em>KPI 必须是客观的、可衡量的，以下是一些常见的 KPI：</em></p>
<p>医疗保健行业：患者等待时间、平均治疗费用</p>
<p>零售行业：坪效、每名员工销售额</p>
<p>人力资源部门：离职率、平均招聘时间</p>
<p>销售部门：销售收入、拨打电话的次数</p>
<p>客服部门： 客户满意度NPS</p>
<p>再来看下OKR</p>
<p>OKR 是 Objective and Key Results 的缩写，中文名称是「目标与关键结果法」，是一套帮助组织实现目标管理、推动执行与协作的工具和方法，关键点<code>工具和方法</code>。</p>
<p>当然KPI也可以理解为方法，但是OKR的工具性和方法指导意义会更强。</p>
<h2 id="OKR"><a href="#OKR" class="headerlink" title="OKR"></a>OKR</h2><p>OKR强调在”第一性原理”思考方式的基础上,聚焦战略<br>重点,提岀鼓舞人心的目标,选择RO更优的策略,从而<br><code>激发组织活力,降低共识成本</code>,促进团队和个人围绕组织<br>目标高效协作.</p>
<p><img src="https://vison-blog.oss-cn-beijing.aliyuncs.com/20210906205210.png" alt=""></p>
<p>一个公司都会指定公司终生奋斗的<code>使命</code>，<code>愿景</code>。</p>
<p>关于<code>使命</code>和<code>愿景</code> 我也听到过我领导跟我讲的比较有意思的解释版本。</p>
<p><code>使命</code> 可能是当下就可以实现的。<br><code>愿景</code> 可能不能实现，但是公司要为之奋斗的目标。</p>
<p>例如 apple 愿景：让每人拥有一台计算机；使命：推广公平的资料使用惯例，建立用户对互联网之信任和信心</p>
<p>言归正传。为了完成<code>使命</code>或者接近<code>愿景</code>。公司高层必然会制定长期的战略计划。</p>
<p>那么为了这些战略计划，每个层级每个人都因为想到<code>我可以完成什么</code>和<code>如何达到目标</code>。</p>
<p>以及更细化的为了落地这些<code>目标</code>和<code>关键结果</code> 需要建立哪些<code>项目</code>或<code>项目任务</code></p>
<p>从宏观的企业战略到微观个人任务，OKR能很好的成为企业目标管理体系和个人的工作方法。</p>
<p><em>OKR是更符合时代需要的管理方法</em></p>
<ul>
<li><p>企业端:VUCA时代,让组织持续进化是应对不确定性的根本</p>
</li>
<li><p>人才端:个体崛起,管理从强调<code>管控走冋自驱与协作</code></p>
</li>
<li><p>普适性:围绕目标开展工作是很自然的事</p>
</li>
<li><p>供给端: OKR SaaS把领先实践产品化,让更多企业以低成本受益</p>
</li>
<li><p>认知:OKR不是万能药,正确认识OKR才能用好OKR</p>
</li>
</ul>
<p><em>战略层面:从长远规划转向敏捷迭代</em></p>
<p>过去企业做战略通常要看3-5年,前提是市场允许你保持线性增长的合理预期。今天,非线性增长成为普遍情况,企业更加聚焦在眼前的半年或一年,以更快的速度应对市场和需求变化。</p>
<p><em>组织层面:从科层制、条线式运作,向分布式决策、网络化协作的方向发展</em></p>
<p><img src="https://vison-blog.oss-cn-beijing.aliyuncs.com/20210907095116.png" alt=""></p>
<p>科层制最大的特点,是指令式的上传下达,每一层都依赖上一层的决策,较为被动低效,也难以产生创新。分布式、网络化的组织里,每个节点(团队或个人)都更加自主的决策和行动,主动发起协作,更及时的响应变化,涌现更多创新。</p>
<p><em>文化层面:从强调管控、一致到更加多元化、兼容并蓄</em></p>
<p>强调管控也是科层制组织特征的延续,今天的组织需要更多样化的思想和实践,产生新的变化,在內外部形成更加健康的生态,才能产生更多可能性。</p>
<p>OKR让每一位员工了解组织的整体目标,找到自己工作与组织目标的联系,获得意义与成就感</p>
<h2 id="OKR认知"><a href="#OKR认知" class="headerlink" title="OKR认知"></a>OKR认知</h2><p><em>第一,OKR并不解决战略规划的问题</em></p>
<p>○KR能够帮助企业更好地思考和落地战略,但不是用了OKR就有更好的战略OKR本质是一种人人皆围绕战略在主动思考并度量结果的方法和工具</p>
<p><em>第二,OKR不能代替领导力</em></p>
<p>仅仅设定一个目标并不能带来成功,领导者、管理者带领团队共同努力,才能更好达成目标各级管理者都必须主动思考业务本质和最佳路径通过OKR分派任务,是对OKR的误用,更是管理上的懒政</p>
<p><em>第三,OKR不是绩效考核</em></p>
<p>目标管理让员工专注思考如何实现目标,绩效考核专注于对员工所做贡献给予公平回报,前者是价值创造,后者是价值分配,二者有本质区别领先实践主张将目标管理和绩效评价解绑。例如谷歌、字节跳动,○KR作为目标管理工具,绩效考核通过360°评价实现。如果直接考核OKR达成率,组织势必又将陷入KP|式的讨价还价,也更容易滋生短期行为</p>
<h2 id="OKR落地"><a href="#OKR落地" class="headerlink" title="OKR落地"></a>OKR落地</h2><p><img src="https://vison-blog.oss-cn-beijing.aliyuncs.com/20210907100005.png" alt=""></p>
<p>OKR的实施步骤遵循经典的“PDCA”目标管理流程。以年度为例,OKR的运行一般遵循</p>
<p>目标制定-过程跟进-总结复盘-考核应用四步实施流程,并形成闭环管理。</p>
<p>在一个年度内,会有多个双月或季度OKR周期,此周期内主要以目标制定-过程跟进-总结复盘环节形成的小闭环进行运作。</p>
<p><img src="https://vison-blog.oss-cn-beijing.aliyuncs.com/20210907100800.png" alt=""></p>
<p><em>五大成功因素</em></p>
<ul>
<li>高层管理者的积极参与</li>
<li>把OKR应用到日常管理</li>
<li>创造良好的实施环境</li>
<li>便捷高效的OKR系统</li>
<li>专门的OKR运营团队</li>
</ul>
<p><img src="https://vison-blog.oss-cn-beijing.aliyuncs.com/20210907101053.png" alt=""></p>
<p>这里我认为 第一 第二点尤为重要。</p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><ul>
<li>OKR不同于KPI，OKR+SMART 也不等于KPI</li>
<li>OKR是更适应当代的管理工具，面对新时代的”人”和瞬即万变的快节奏</li>
<li>OKR更注重目标导向,没有精确规结果，更能激发团队自主性</li>
<li>并不意味着可以摈弃KPI，而应采取OKR为主KPI为辅的方式。</li>
<li>对KPI的认知尤为重要，上到最高层下到基层都应该理解OKR的作用和如何运用OKR。</li>
<li>所有管理方法都应以人为本，离不开基础的沟通、演讲技巧。要让方法发挥功效，还需要有强大的感召力。</li>
</ul>
 
      <!-- reward -->
      
      <div id="reword-out">
        <div id="reward-btn">
          Donate
        </div>
      </div>
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>Copyright： </strong>
          
          Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://visonforcoding.xyz/2021/09/06/%E5%85%B3%E4%BA%8EOKR%E7%9A%84%E6%80%9D%E8%80%83/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E7%AE%A1%E7%90%86/" rel="tag">管理</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2021/09/09/%E5%86%99%E5%A5%BD%E4%BB%A3%E7%A0%81%E7%9A%84%E4%B8%83%E7%A7%8D%E6%AD%A6%E5%99%A8%E4%B9%8B%E4%BE%9D%E8%B5%96%E6%B3%A8%E5%85%A5/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            写好代码的七种武器之依赖注入
          
        </div>
      </a>
    
    
      <a href="/2021/07/30/%E4%BB%A3%E7%A0%81%E6%95%B4%E6%B4%81%E4%B9%8B%E9%81%93/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">架构|代码整洁之道</div>
      </a>
    
  </nav>

   
<!-- valine评论 -->
<div id="vcomments-box">
  <div id="vcomments"></div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<script>
  new Valine({
    el: "#vcomments",
    app_id: "",
    app_key: "",
    path: window.location.pathname,
    avatar: "monsterid",
    placeholder: "给我的文章加点评论吧~",
    recordIP: true,
  });
  const infoEle = document.querySelector("#vcomments .info");
  if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
    infoEle.childNodes.forEach(function (item) {
      item.parentNode.removeChild(item);
    });
  }
</script>
<style>
  #vcomments-box {
    padding: 5px 30px;
  }

  @media screen and (max-width: 800px) {
    #vcomments-box {
      padding: 5px 0px;
    }
  }

  #vcomments-box #vcomments {
    background-color: #fff;
  }

  .v .vlist .vcard .vh {
    padding-right: 20px;
  }

  .v .vlist .vcard {
    padding-left: 10px;
  }
</style>

 
   
     
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2015-2022
        <i class="ri-heart-fill heart_icon"></i> vison
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>    
    </main>
    <div class="float_btns">
      <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

    </div>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="麦田麦穗"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E6%97%85%E8%A1%8C/">旅行</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" target="_blank" rel="noopener" href="http://shenyu-vip.lofter.com">摄影</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友链</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about">关于我</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/null">Gallery</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>Buy me a cup of coffee~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpeg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wallet.png">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-3.6.0.min.js"></script>
 
<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->
 
<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: ".tocbot",
    contentSelector: ".article-entry",
    headingSelector: "h1, h2, h3, h4, h5, h6",
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: "main",
    positionFixedSelector: ".tocbot",
    positionFixedClass: "is-position-fixed",
    fixedSidebarOffset: "auto",
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->
 <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script> 
<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->
 
<script src="/js/busuanzi-2.3.pure.min.js"></script>
 
<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->
 
<link rel="stylesheet" href="/css/clipboard.css">
 <script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>
 
<!-- CanvasBackground -->

<script>
  if (window.mermaid) {
    mermaid.initialize({ theme: "forest" });
  }
</script>


    
    

  </div>
</body>

</html>